import React from "react";
import * as THREE from "three";
import Controller from "..";

export default function useReceiveProps(controller: Controller, geometry?: THREE.BufferGeometry, onChange?: (e: THREE.BufferGeometry) => void) {
    React.useEffect(()=>{
        controller.run(async s=>{
            s.geometry = geometry;
            s.onChange = onChange;
        })
    }, [controller, geometry, onChange])
}